package cn.wowjoy.pda.android_pharmacy.common.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Comparator;
import java.util.Date;

import cn.wowjoy.pda.android_pharmacy.model.xmlEntity.putInfo.PutTotalBeen;

/**
 * Created by Administrator on 2017/9/11.
 */

public class PutBeenDataCompare implements Comparator<PutTotalBeen> {
    SimpleDateFormat sdf =   new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    @Override
    public int compare(PutTotalBeen o1, PutTotalBeen o2) {
        try {
            Date parse1 = sdf.parse(o1.getDJFSRQ());
            Date parse2 = sdf.parse(o2.getDJFSRQ());
            return -parse1.compareTo(parse2);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return 0;
    }
}
